/*
Filename:    sctp_one_to_one_connection.cpp
Author:      Erik Öjebo
Date:        2009-01-10
Description: Represents an SCTP one-to-one connection.
Notes:       Can only be instantiated with an existing socket currently.
*/

// See header file for documentation.

#include "sctp_one_to_one_connection.h"
#include <stdexcept>
#include <cerrno>
#include <netinet/sctp.h>

SctpOneToOneConnection::SctpOneToOneConnection(int socketFd)
{
    // Use the given socket as the socket for the connection:
    this->socketFd = socketFd;

    // Call base class initialization to initialize state:
    initialize();
}

ssize_t SctpOneToOneConnection::send(void const * const buffer, size_t size,
        unsigned int streamNumber) const
{
    // Call base class send method with association number zero:
    // This simple wrapper method simplifies the interface of the class
    // slightly.
    return SctpConnection::send(buffer, size, 0, streamNumber);
}
